package cn.gok.controller;

import cn.gok.entity.User;
import lombok.NoArgsConstructor;
import org.springframework.http.HttpMethod;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
        @RestController 注解：   当前Controller 的所有方法都响应JSON数据
 */
@RestController
public class UserController5 {

    @PostMapping(value = "/test05")
    public Map<String,Object> testJson05(@RequestBody User user){
        System.out.println(user);

        Map<String, Object> result = new HashMap<>();
        result.put("code","200");
        result.put("msg","操作成功");
        return result;
    }
}
